package com.enterprise.projectManager.rope;

import com.enterprise.projectManager.model.Log;
import com.enterprise.projectManager.model.Project;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ProjectRope extends JpaRepository<Project,String>, JpaSpecificationExecutor<Project> {
    Long countByProjectState(String state);
    Long countByProjectCurrentPhase(String phase);
    // 查询所有不同的 place 值
    @Query("SELECT DISTINCT p.projectPlace FROM Project p WHERE p.projectPlace IS NOT NULL")
    List<String> findAllDistinctPlaces();
}
